vcApplication

vcApplication is the object type for the main application, thereby granting access to the application's GUI, commands and other common properties.

See in: Overview

Module: vcCore

Parent: -

Children -

Referenced by: vcCore.getApplication()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
ContextManagervcContextManagerRA container that provides access to vcContext objects in the application and possibility to change active one.
LayerManagervcLayerManagerRA container that provides access to vcLayer objects currently present and possibility to create new ones.
LayoutVisualizationSettingsvcLayoutVisualizationSettingsRGets the application wide default visualization settings used for sub-layouts without customized settings.
LocalizationServicevcLocalizationServiceRGets the localization service.
MaterialsvcList[vcMaterial]RGets a list of all materials in the application.
MaxRecursionDepthIntegerRWGets or sets maximum recursion depth.
See more
Note that this affects VC API recursion depth which is different from Python's recursion limit. Use caution when changing the value as it may result in unexpected behavior.

Exceptions:
ValueError: When given value is smaller than 10 or current recursion depth.
MessageServicevcMessageServiceRGets the message service used to add messages, clear messages, and handle message scopes.
PdfRecordervcPdfRecorderRGets the PDF Recorder. Every instance of vcPdfRecorder control the same global PDF recorder.
RobotSelectionServicevcRobotSelectionServiceRGets the Robot Selection Service.
SelectionManagervcSelectionManagerRGets the Selection Manager.
SnapServicevcSnapServiceRGets the Snap Service.
TopologyPickServicevcTopologyPickServiceRTopology pick service provides options for handling the selection and creation of points, lines, and curves using the interactiveTopologyPick command..
VideoRecordervcVideoRecorderRGets the Video Recorder. Every instance of vcVideoRecorder controls the same global video recorder.
WorldManagervcWorldManagerRGets the simulation world manager.
Only available for scripts that are not tied to a specific world, like application commands.
See more
For other scripts, use getWorld().

Exceptions:
RuntimeError: When the calling script is not allowed to access other worlds than its owner.
"

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
createMaterialvcMaterialString nameCreates a new material with a given name.
See more
It also registers the material with the application.

Parameters:
name (str): The name of the material.

Exceptions:
RuntimeError: When a material with the same name already exists.

Returns:
vcMaterial: The material.
executeActionItemtupleString itemIdExecutes a .NET ActionItem object. Given arguments will be used as values for the properties passed to ActionItem.Execute(PropertyCollection args) method.
See more
ActionItem may return data back by updating values of these properties and therefore all property values are provided as a return value.

Parameters:
itemId (str): Action item id.
args (*args): Variable length argument list.

Exceptions:
ValueError: When no action item with the given id is found.
TypeError: When any of the given argument types is not supported.

Returns:
tuple: Contains values for properties passed to the action item.

See itemId's
findMaterialvcMaterialString nameFinds the material matching the given name.
See more
If no material is found then None is returned.

Parameters:
name (str): The name of the material.

Returns:
vcMaterial or None: The material.
loadVCMXvcNodeString uriLoads the contents of a VCMX file into the 3D world.
See more
Note: In most cases, the file URI scheme is file:/// followed by the full path to file.

Parameters:
uri (str): The file path or URI of the .vcmx file to load.

Returns:
If loading is successful, returns the component; otherwise returns None.
renderNoneNoneRenders the scene of 3D world.
saveVCMXNoneString uri,
Boolean includecomponents
Saves the contents of 3D world as a layout using a given uri.
See more
Parameters:
uri (str): The file path or URI where the .vcmx file will be saved.
includecomponents (bool): Defines if the components are included in the layout.

Exceptions:
RuntimeError: If the save operation fails.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnRendervcSimulation simulationTriggered when the application renders a scene in 3D world.

Parameters:
simulation (vcSimulation): The rendered simulation.

Example: Find Component From World

"""Finding a component is done via vcWorld in py3 api.
This example shows how to find a component by its name in the world.
"""

import vcCore as vc

world = vc.getWorld()
found_comp = world.findComponent("MyCustomComponent")
print (found_comp.Name)